<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="l" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Lite - Bootstrap Skin</title>
    
    
    <!-- Favicon -->
    <link rel="shortcut icon" href="img/favicon.ico" />
    
    <!-- CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <link href="css/font-awesome.min.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet" />
    
    <!-- Google Fonts -->
    <link href='http://fonts.useso.com/css?family=Titillium+Web' rel='stylesheet' type='text/css'>
	<script type="text/javascript">
	 	function changePage(index){
	 		//更改隐藏域中page的值
	 		document.myForm.page.value= index;
	 		//提交表单
	 		document.myForm.submit();
	 	}
	 	function getOne(mid) {
			window.location = "AllMessage.do?type=getOne&&mid="+mid;
		}
	 </script>
	 <script type="text/javascript">
		var url = document.referrer;
	 </script>
	 
</head>

<body>

    <!-- Start: Preloader -->
    <div id="preloader">
        <div id="loader"></div>
    </div>
    <!-- End: Preloader -->

    <!-- Start: Main Content -->
    <div class="main-container">
        
        <!-- Start: Home -->
        <section class="home-section">
            <div class="container" style="margin-top: 80px">
				<div class="row">
					<div class="col-md-12 col-sm-12 col-xs-12">
						<h1 style="color: FFFFFF">图书商城</h1>
					</div>
				</div>
            </div>
        </section>
        <!-- End: Home -->
		
		<!-- Start: Content -->
        <section class="content-section">
            <div class="container" style="margin-top: 80px">
				<div class="row">
					<div class="col-md-12">
						<nav role="navigation" class="navbar navbar-default">	
						
							<div class="navbar-header">
								<button data-target="#bs-example-navbar-collapse-1" data-toggle="collapse" class="navbar-toggle" type="button">
									<span class="sr-only">Toggle navigation</span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
									<span class="icon-bar"></span>
								</button>
								<a href="#" class="navbar-brand"></a>
                                <a href="#" class="navbar-brand"></a>
                                <a href="#" class="navbar-brand"></a>
                                <a href="#" class="navbar-brand"></a>
							</div>							
							<div id="bs-example-navbar-collapse-1" class="collapse navbar-collapse">
								<ul class="nav navbar-nav">
									<li><a href="SelectBook.do?type=all">首页</a></li>
									<li><a href="carGood.jsp">购物车</a></li>
                                    <li><a href="SelectOrderInfo.do?type=orderInfo">订单</a></li>
									<li class="dropdown"  class="active">
										<a data-toggle="dropdown" class="dropdown-toggle" href="SelectMessage.do?type=all">留言空间 <b class="caret"></b></a>
										<ul role="menu" class="dropdown-menu">
											<li><a href="SelectMessage.do?type=all">全部留言</a></li>
											<li><a href="SelectMessage.do?type=my">我的留言</a></li>
											<li><a href="message_add.jsp">写留言</a></li>
										</ul>
									</li>
								</ul>
								<form role="search" class="navbar-form navbar-left" action="SelectBook.do?type=search" method="post">
									<div class="form-group">
										<input type="text" class="form-control" name="keyword">
									</div>
									<button class="btn btn-danger" type="submit">搜一下</button>
								</form>
								<ul class="nav navbar-nav navbar-right">
									<li><a href="login_user.jsp">登录</a></li>
                                    <li><a href="Logout.do">注销</a></li>
									
								</ul>
							</div>
						</nav>
					</div>
				</div>
			
				
				<div class="row">
				   <div class="col-lg-12">
					  <!-- START panel-->
					  <div class="panel panel-default">
						 <form action="SelectMessage.do?type=my" method="post">
						 <div class="panel-heading">
						 	 <p class="lead text-muted">全部留言
						 	 <button class="btn btn-danger btn-lg" data-toggle="modal" data-target="#myModal" >看我的留言</button>
						 	 </p>
						 	 <!-- <button class="btn btn-danger btn-lg" data-toggle="modal" data-target="#myModal" style="padding-right: 20">看我的留言</button> -->
							<%--  <ul class="nav navbar-nav navbar-right"><li><button class="btn btn-danger btn-lg" data-toggle="modal" data-target="#myModal" style="padding-right: 20">看我的留言</button>&nbsp;&nbsp;&nbsp;</li></ul> --%>
						</div>
						</form>
						<form action="SelectMessage.do?type=all" method="post" name="myForm">
					    	<input type="hidden" name="page" value="1"/>
					     </form>
					     
						 <div class="panel-body">
						 <l:if test="${! empty pv.pageList}">
							<div id="accordion" class="panel-group">
								
								<l:forEach items="${pv.pageList}" var="l">
									<input type="hidden" name="mid" value="${l.mid}">
							   <div class="panel panel-default" style="font-family: 黑体;">
								  <div class="panel-heading" ><!--  href="#${l.mid}" -->
									 <div style="font-size: 18px"><a style="color:#CC3300;text-decoration: none;" onclick="getOne(${l.mid})">标题：${l.title}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;时间：${l.mtime}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 来自：${l.user}</a>
									 </div>
								  </div>
								  <div class="panel-collapse collapse in"><!-- id="${l.mid}" -->
									 <div class="panel-body" style="font-size: 16px">详情：${l.content}</div>
								  </div>
							   </div>
							   </l:forEach>
								
							  
							   
							</div>
							<div style="margin-left: 420;font-size: 20" >
								<l:choose>
									<l:when test="${pv.pageIndex==1 }"> 上一页</l:when>
									<l:otherwise>
										<a href="javascript:changePage(${pv.pageIndex-1 })">上一页</a>&nbsp;&nbsp;&nbsp;
						        	</l:otherwise>
								</l:choose> 
								<!-- 中间页 --> 
								<l:forEach var="i" begin="1" end="${pv.totalPage}">
									<l:choose>
										<l:when test="${i==pv.pageIndex }"> ${i}</l:when>
										<l:otherwise>
											<a href="javascript:changePage(${i })">${i }</a>&nbsp;&nbsp;&nbsp;
						        		</l:otherwise>
									</l:choose>
								</l:forEach> 
								<!-- 下一页 --> 
								<l:choose>
									<l:when test="${pv.totalPage==pv.pageIndex }"> 下一页</l:when>
									<l:otherwise>
										<a href="javascript:changePage(${pv.pageIndex+1 })">下一页</a>&nbsp;&nbsp;&nbsp;
						        	</l:otherwise>
								</l:choose>
							</div>
							</l:if>
							
						 </div>
						 
					  </div>
					  
				   </div>
				   
				</div>
			</div>
            </div>
        </section>
        <!-- End: Content -->
        
        <!-- Start: Footer-->
        <footer class="footer">
            <p>Copyright &copy; 2017.Company name All rights reserved.</p>
        </footer>
        <!-- End: Footer -->
        
    </div>
    <!-- End: Main Content -->
    
    <!-- Javascript Files -->
    <script type="text/javascript" src="js/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/jquery.pagination.js"></script>
	<script type="text/javascript" src="js/jquery.knob.min.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
</body>
</html>
